/**
 * Created by Administrator on 2017/9/20.
 */
define(['knockout', 'loginModule','jquery','knockout-validation'], function (ko, lgm,$) {

    var self = this;

    this.username = ko.observable("");
    this.password = ko.observable("");
    this.identityList = ko.observableArray();
    this.initInfo = ko.observable();

    lgm.initSelectList(self);

    this.selectedIdentity = ko.observable(0);
    this.selectChange = function () {
        lgm.selectChange(self);
    };

    this.userLogin = function(data, root){
        //console.log(ko.dataFor($("body")[0]));
        lgm.submitLoginInfo(self,root);
        //console.log(data);
        //console.log(root);
    };


    return {
        username : self.username,
        password : self.password,
        identityList : self.identityList,
        selectChange : self.selectChange,
        userLogin : self.userLogin,
        submitBtn : "登录"

    };

});


